#include <iostream>
#include <string.h>
#include <stdio.h>
#include <stack>
using namespace std;
int main(){
	
	stack<char> s1;
	int i;
	int x;
	char str[1000];
	cin>>str;
	for(i=0;i<strlen(str);i++){
		
		if(str[i]>='0'&&str[i]<='9')
		printf("%c",str[i]);
		else if(str[i]==')')
		{
			char ch=s1.top();
			printf("%c",s1.top());
			s1.pop();
			while(s1.top()=='(')
			return 0;
		}
		else if(((s1.top()=='+')||(s1.top()=='-')||(s1.top()=='*')||(s1.top()=='/'))&&(str[i]=='+'||str[i]=='-'))
		{
			printf("%c",s1.top());
			s1.pop();
		}
		s1.push(str[i]);	
	}
	   
	for(i=0;i<strlen(str);i++)
	{
		printf("%c",s1.top());}
	
}
 
